# * 导包
import time
import unittest
import HTMLTestRunner_PY3
import app
from script.test_emp_params import TestIHRMEmployeeParams
from script.test_login_params import TestLoginParams
# * 创建测试套件
suite = unittest.TestSuite()
# * 将测试用例添加到测试套件
suite.addTest(unittest.makeSuite(TestLoginParams))
suite.addTest(unittest.makeSuite(TestIHRMEmployeeParams))
# * 生成测试报告
with open(app.BASE_DIR + "/report/ihrm_report{}.html".format(time.strftime('%Y%m%d %H%M%S')),
          mode='wb') as f:
    # 实例化HTMLTestRunner_PY3
    runner = HTMLTestRunner_PY3.HTMLTestRunner(f)
    # 使用runner运行测试套件
    runner.run(suite)

